<template>
  <div class="category-container">
    <el-table :data="fileList">
      <el-table-column
        label="文档目录"
        align="center"
        key="categoryName"
        prop="categoryName"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="文档名称"
        align="center"
        key="title"
        prop="title"
        width="220"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        v-for="item in fieldList"
        :key="item.prop"
        :label="item.label"
        align="center"
      >
        <template #default="scope">
          <el-switch
            v-model="scope.row[item.prop]"
            inline-prompt
            active-value="1"
            inactive-value="0"
            active-text="开"
            inactive-text="关"
            :disabled="!$permission('categoryFile:save')"
          />
        </template>
      </el-table-column>
      <!-- <el-table-column label="安全等级" align="center" key="applicationStatus">
        <template #default="scope">
          <el-switch
            v-model="scope.row.applicationStatus"
            inline-prompt
            active-value="1"
            inactive-value="0"
            active-text="开"
            inactive-text="关"
          />
        </template>
      </el-table-column>
      <el-table-column label="下载" align="center" key="downloadStatus">
        <template #default="scope">
          <el-switch
            v-model="scope.row.downloadStatus"
            inline-prompt
            active-value="1"
            inactive-value="0"
            active-text="开"
            inactive-text="关"
          />
        </template>
      </el-table-column> -->
    </el-table>
  </div>
</template>

<script setup name="publishList">
const props = defineProps({
  total: {
    type: Number,
    default: () => {
      return 0
    },
  },
  queryParams: {
    type: Object,
    default: () => {
      return {}
    },
  },
  fileList: {
    type: Array,
    default: () => {
      return []
    },
  },
  dateRange: {
    type: Array,
    default: () => {
      return []
    },
  },
})
const fieldList = [
  {
    label: '允许下载',
    prop: 'allowDownloads',
    value: '0',
  },
  {
    label: '允许上传',
    prop: 'allowUpload',
    value: '0',
  },
  {
    label: '允许查看',
    prop: 'allowView',
    value: '0',
  },
  {
    label: '允许预览',
    prop: 'allowPreview',
    value: '0',
  },
  // {
  //   label: '允许删除',
  //   prop: 'allowDeleted',
  //   value: '0',
  // },
  {
    label: '允许打印',
    prop: 'allowPrint',
    value: '0',
  },
]
</script>

<style lang="scss" scoped>
.category-container {
  max-height: 500px;
  overflow-y: scroll;
}
</style>
